<template>
  <div>
    <!-- 默认选中
                1：el-tree
                    node-key="数据每一项的唯一标识的字段名，一般都是id"
                    :default-checked-keys="[需要选中项的唯一标识]"
     -->
    <el-tree
      check-strictly
      :default-checked-keys="['4']"
      node-key="id"
      show-checkbox
      :data="list"
      :props="{ label: 'city' }"
    />
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [
        {
          city: '广东省',
          id: '1',
          children: [
            {
              city: '深圳市',
              id: '2',
              children: [
                {
                  city: '宝安',
                  id: '3'
                }
              ]
            }
          ]
        },
        {
          city: '广西省',
          id: '4'
        }
      ]
    }
  }
}
</script>
<style></style>
